package rd.android.hardcore.datas 
{
	
	/**
	 * Track Data Format
	 * @author Romain Prache
	 */
	public class Track 
	{
		/* VAR */
		public var keyId	: int;
		public var file		: String = "";
		public var thumb	: String = "";
		public var desc		: String = "";
		
		
		public function Track() 
		{
			
		}
		
		public function build ( _node : XML ) : void
		{
			keyId 	= int(_node.@keyId.toString() );
			file	= _node.@file.toString();
			thumb	= _node.@pad_thumb.toString();
			desc	= _node.toString();
		}
		
		public function genChild():XML
		{
			//desc = file.replace([".mp3", ".wav", "medias/songs/"], "");
			desc = file.replace(".wav", "");
			desc = desc.replace(".mp3", "");
			desc = desc.replace("medias/songs/", "");
			var child:XML = new XML("<track keyId=\""+keyId+"\" file=\""+file+"\" pad_thumb=\""+thumb+"\"><![CDATA["+desc+"]]></track>") ;
			return child;
		}
		
	}
	
}